package com.flower.wx.handler;

/**
 * @author lavender
 * @version 1.0
 * @date 2024-07-19 0:04
 */
public enum WxChatMsgTypeEnum {
    SUBSCRIBE("event.subscribe","用户关注事件"),
    TEXT_MESSAGE("text","文本消息"),
    IMAGE_MESSAGE("image","图片消息"),
    VOICE_MESSAGE("voice","语音消息"),
    VIDEO_MESSAGE("video","视频消息"),
    LOCATION_MESSAGE("location","地理位置消息"),
    LINK_MESSAGE("link","链接消息"),
    EVENT("event","事件推送"),
    UNSUBSCRIBE("event.unsubscribe","用户取消关注事件"),
    CLICK("event.click","菜单点击事件"),
    VIEW("event.view","菜单跳转事件");


    private String msgType;

    private String desc;
    WxChatMsgTypeEnum(String msgType, String desc) {
        this.msgType = msgType;
        this.desc = desc;
    }


    public static  WxChatMsgTypeEnum getByMsgType(String msgType) {
        for (WxChatMsgTypeEnum wxChatMsgTypeEnum : WxChatMsgTypeEnum.values()){
            if(wxChatMsgTypeEnum.msgType.equals(msgType)){
                return wxChatMsgTypeEnum;
            }
        }
        return null;
    }
}

